package web.form;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;

public class Block {
	private String label;
	private List<Item> items;
	private List<Link> links;

	
	@SuppressWarnings("unchecked")
	public Block() {
		items =  LazyList.decorate(new ArrayList<Item>(), FactoryUtils.instantiateFactory(Item.class));
		links = LazyList.decorate(new ArrayList<Link>(), FactoryUtils.instantiateFactory(Link.class));
	}

	@SuppressWarnings("unchecked")
	public Block(String label, List<Item> items) {
		this.label = label;
		this.items = items;
		links = LazyList.decorate(new ArrayList<Link>(), FactoryUtils.instantiateFactory(Link.class));
	}
	
	public Block(String label, List<Item> items, List<Link> links) {
		this.label = label;
		this.items = items;
		this.links = links;
	}
	
	public String getLabel() {
		return label;
	}
	public void setLabel(String label) {
		this.label = label;
	}
	public List<Item> getItems() {
		return items;
	}
	public void setItems(List<Item> items) {
		this.items = items;
	}
	public List<Link> getLinks() {
		return links;
	}
	public void setLinks(List<Link> links) {
		this.links = links;
	}
}
